      SUBROUTINE DEREQT(DEP)
C
      IMPLICIT REAL*8(A-H,O-Z)
C
      COMMON/ADDMOM/ HDUMMY(9),HTIP(3)
C
      COMMON/DEBUG2/ IOUT,JOUT,KLUGE
C
      COMMON/INEWR /NKT(10),ICP,ICPS
C
      COMMON/INTTRP/ITPROT,NUMTIP(10)
C
      COMMON/IPOOL1/IGRAV,IDAMP,IK,K1,ITIM,IAB,IAPS,IBB,IBPS,NK(10)
     1             ,LK(10),LLK(10)
C
      COMMON/RNEWC / ZGJ(10),ZEDQ(10),ZO(10),ZED2(10),ZED3(10)
C
      COMMON/RNEWR / ZA(10),CI3(10),C2OV3(10)
C
      COMMON/RPOOL1/RHOK(10),TIME,SA(3,3),FM1(3,3),ZLK(10),OMEG(3)
     1             ,ZLKP(10),ZLKPP(10),CMAT(3,3),GBAR(3,3),YBCM(3)
     2             ,ZBZK(3,10),FCM(3,3),DTO,PHID,PHI
C
      COMMON/RPOOL5/CKMAT(3,3,10),FM2(3,3)
C
      COMMON/RPOOL9/RT1(7),RT2(10,9),ALP(7,7),GAM(10,9,7),DEL(10,9,9)
C
      COMMON/ITWWRK/NKB,NTW,NTT,ILK,ILLK
C
      COMMON/TWWORK/FM(3,3),A(3),AD(3),B(3),BD(3),C(3),CD(3),ZL,RO
     1             ,RSQT(3),W2,W3,EIM,ED2,ED3,EDP,GJ,HKT(3)
C
      COMMON/TWWRK1/WV(228)
C
      COMMON/TMSINR/ TIPINR(3,10),RSQ(3,10),XIPL(6),BETL(6)
C
      COMMON/TPWORK/ XIPK(3),BETK(3)
C
      COMMON/TWIDMP/ CDTW(3,10)
C
      COMMON/WRKTDP/ CDMP(3)
C
C
      DIMENSION DEP(150),YY(3,3),YYD(3,3),ZZ(3,3),ZZD(3,3),YYDD(3)
C
      DIMENSION ZZDD(3)
C
      DIMENSION DUM1(3,3),DUM2(3,3),DUM3(3,3)
C
      DIMENSION GBY(3,3),GBK(3,3),OMK(3),VW1(3),VW2(3)
C
      DIMENSION YKYDD(3),YKYD(3,3),YKY(3,3)
C
      DIMENSION CON2(3),CON3(3),GGM(3),II(3),JJ(3)
C
      DIMENSION OMZ(3),GBZ(3,3),ZKZ(3,3),ZKZD(3,3),ZKZDD(3)
C
      DIMENSION     XX(3,3),XXD(3,3),XXDD(3),XXA(3,3,3),XXB(3,3,3)
     1             ,XXC(3,3,3),XDXA(3,3),XDXB(3,3),XDXC(3,3),XDDXA(3)
     2             ,XDDXB(3),XDDXC(3),XAX(3,3),XBX(3,3),XCX(3,3)
     3             ,DLAA(3,3),DLAB(3,3),DLAC(3,3),DLBB(3,3),DLBC(3,3)
     4             ,DLCC(3,3),VIFA(3),VIFB(3),VIFC(3)
C
      EQUIVALENCE (WV(1),XX(1,1)),(WV(10),XXD(1,1)),(WV(19),XXDD(1))
     1           ,(WV(22),XXA(1,1,1)),(WV(44),XXB(1,1,1))
     2           ,(WV(76),XXC(1,1,1)),(WV(103),XDXA(1,1))
     3           ,(WV(103),XDXA(1,1)),(WV(112),XDXB(1,1))
     4           ,(WV(121),XDXC(1,1)),(WV(130),XDDXA(1))
     5           ,(WV(133),XDDXB(1)),(WV(136),XDDXC(1))
     6           ,(WV(139),XAX(1,1)),(WV(148),XBX(1,1))
     7           ,(WV(157),XCX(1,1)),(WV(166),DLAA(1,1))
     8           ,(WV(175),DLAB(1,1)),(WV(184),DLAC(1,1))
     9           ,(WV(193),DLBB(1,1)),(WV(202),DLBC(1,1))
     A           ,(WV(211),DLCC(1,1)),(WV(220),VIFA(1))
     B           ,(WV(223),VIFB(1)),(WV(226),VIFC(1))
C
      DATA II/2,3,1/,JJ/3,1,2/
C
      DATA DZERO/0.0D0/
C
C     EXTRACT INTEGER DATA
      IF(IOUT.NE.1) WRITE(6,6004) RT1
C
      IA=IAB-1
      IB=IBB-1
      IC=ICP-1
C
C     ZERO OUT SYSTEM ARRAYS
C
      DO 2 I=1,3
      DO 1 J=1,3
      YY(I,J)=DZERO
      YYD(I,J)=DZERO
      ZZ(I,J)=DZERO
      ZZD(I,J)=DZERO
    1 CONTINUE
      YYDD(I)=DZERO
      ZZDD(I)=DZERO
      HTIP(I)=DZERO
    2 CONTINUE
C
      CALL MPYMAT(SA,GBAR,SA,2,2,DUM1,GBY)
C
      IF(IOUT.NE.1) WRITE(6,6001) DEP
C
C     CONSTRUCT K - LOOP FOR ELEMENTS
C
      DO 500 K=1,IK
C
C     EXTRACT INTEGER CONTROL VARIABLES
C
      NKB=NK(K)
      NTW=NKT(K)
      NTT=NUMTIP(K)
      ILK=LK(K)
      ILLK=LLK(K)
C
      ITEST=NTW+NTT
      IF(ITEST.EQ.0) GO TO 500
C
C     EXTRACT TRANSFORMATION MATRICES
C
      DO 5 I=1,3
      DO 4 J=1,3
      CMAT(I,J)=CKMAT(I,J,K)
      IF(K.GT.K1) GO TO 3
      FM(I,J)=FM1(I,J)
      GO TO 4
    3 CONTINUE
      FM(I,J)=FM2(I,J)
    4 CONTINUE
      HKT(I)=DZERO
    5 CONTINUE
C
      CALL MPYMAT(FM,CMAT,DUM1,1,1,FCM,DUM1)
C
C     EXTRACT ELEMENT DEPENDENT VARIABLES FROM DEP VECTOR
C
      DO 6 I=1,3
      A(I)=DZERO
      B(I)=DZERO
      C(I)=DZERO
      AD(I)=DZERO
      BD(I)=DZERO
      CD(I)=DZERO
    6 CONTINUE
C
      IF(NKB.EQ.0) GO TO 15
C
      DO 12 I=1,NKB
      I1=IA+I
      I2=I1+NKB
      I3=IB+I
      I4=I3+NKB
      A(I)=DEP(I1)
      AD(I)=DEP(I2)
      B(I)=DEP(I3)
      BD(I)=DEP(I4)
   12 CONTINUE
C
   15 CONTINUE
C
      IF(NTW.EQ.0) GO TO 20
C
      DO 17 I=1,NTW
      I1=IC+I
      I2=I1+NTW
      C(I)=DEP(I1)
      CD(I)=DEP(I2)
   17 CONTINUE
C
   20 CONTINUE
C
C     EXTRACT ELEMENT DATA
C
      ZL=ZLK(K)
      RO=RHOK(K)
C
C     FILL IN FOR RSQT,W2,W3,EIM,ED2,ED3,EDP,GJ
C
      EIM=ZO(K)
      ED2=ZED2(K)
      ED3=ZED3(K)
      EDP=ZEDQ(K)
      GJ=ZGJ(K)
      I11=0
      IF(ILK.EQ.2) I11=3
      WS1=ZL*RO
      DO 21 I=1,3
      IND=I11+I
      RSQT(I)=RSQ(I,K)/WS1
      CDMP(I)=CDTW(I,K)
      XIPK(I)=XIPL(IND)
      BETK(I)=BETL(IND)
   21 CONTINUE
      W3=CI3(K)/ZA(K)/144.0D0
      W2=W3*C2OV3(K)
C
C
C     ZERO OUT WORK COMMON
C
      DO 50 I=1,228
      WV(I)=DZERO
   50 CONTINUE
C
      IF(IOUT.NE.1) WRITE(6,6001) W2,W3,ZL,RO,EIM,ED2,ED3,EDP,GJ
      IF(IOUT.NE.1) WRITE(6,6001) A,B,C
      IF(IOUT.NE.1) WRITE(6,6001) XIPK,BETK,RSQT
C
C     CONSTRUCT BASIC ARRAYS FOR TIP MASS
C
      IF(NTT.EQ.0) GO TO 55
C
      CALL FNDTIP
C
      IF(IOUT.EQ.1) GO TO 55
      WRITE(6,6000)
      WRITE(6,6001) WV
   55 CONTINUE
C
C
C     ADD TWIST EQUATIONS IF TWIST IS PRESENT
C
      IF(NTW.EQ.0) GO TO 60
C
      CALL FNDINT
C
      CALL FINDTW
C
   60 CONTINUE
C
      IF(IOUT.EQ.1) GO TO 61
      WRITE(6,6000)
      WRITE(6,6001)  WV
 6000 FORMAT('0',10X,'WORK VECTOR FROM DEREQT'/)
 6001 FORMAT(' ',1P9E14.6)
   61 CONTINUE
C
      ITEST1=NKB+NTW
C
      IF(ITEST1.EQ.0) GO TO 400
C
C
C     ADD TIP MASS AND TWIST EFFECTS FOR THIS ELEMENT
C
      DO 62 I=1,3
      OMK(I)=FCM(1,I)*OMEG(1)+FCM(2,I)*OMEG(2)+FCM(3,I)*OMEG(3)
      HTIP(I)=HTIP(I)+FCM(1,I)*HKT(1)+FCM(2,I)*HKT(2)+FCM(3,I)*HKT(3)
   62 CONTINUE
C
      IF(IDAMP.EQ.0.OR.K.GT.K1) GO TO 70
      DO 65 I=1,3
      OMK(I)=OMK(I)+CMAT(I,2)*PHID
   65 CONTINUE
C
   70 CONTINUE
C
      O11=OMK(1)*OMK(1)
      O12=OMK(1)*OMK(2)
      O13=OMK(1)*OMK(3)
      O22=OMK(2)*OMK(2)
      O23=OMK(2)*OMK(3)
      O33=OMK(3)*OMK(3)
C
C     TRANSFORM GBY TO ELEMENT FRAME
C
      CALL MPYMAT(FCM,GBY,FCM,2,2,DUM1,GBK)
C
      NKB2=2*NKB
C
      IF(NKB.EQ.0) GO TO 200
C
      DO 100 I=1,NKB
      I1=NKB+I
C
C     AUGMENT DELTA MATRIX
C
      DO 72 J=1,NKB
      J1=NKB+J
      DEL(K,I,J)=DEL(K,I,J)+DLAA(I,J)
      DEL(K,I,J1)=DEL(K,I,J1)+DLAB(I,J)
      DEL(K,I1,J1)=DEL(K,I1,J1)+DLBB(I,J)
      DEL(K,J1,I)=DEL(K,I,J1)
   72 CONTINUE
C
      IF(NTW.EQ.0) GO TO 75
C
      DO 74 J=1,NTW
      J1=NKB2+J
      DEL(K,I,J1)=DEL(K,I,J1)+DLAC(I,J)
      DEL(K,I1,J1)=DEL(K,I1,J1)+DLBC(I,J)
      DEL(K,J1,I)=DEL(K,I,J1)
      DEL(K,J1,I1)=DEL(K,I1,J1)
   74 CONTINUE
C
   75 CONTINUE
C
C     AUGMENT GAMMA SYSTEM COUPLING MATRIX
C
      DO 76 J=1,3
      VW1(J)=FCM(J,1)*XAX(I,1)+FCM(J,2)*XAX(I,2)+FCM(J,3)*XAX(I,3)
      VW2(J)=FCM(J,1)*XBX(I,1)+FCM(J,2)*XBX(I,2)+FCM(J,3)*XBX(I,3)
   76 CONTINUE
C
      DO 78 J=1,3
      J1=J+3
      GAM(K,I,J1)=GAM(K,I,J1)+VW1(J)
      GAM(K,I1,J1)=GAM(K,I1,J1)+VW2(J)
   78 CONTINUE
C
      IF(IDAMP.EQ.0.OR.K.GT.K1) GO TO 80
C
      WS1=CMAT(2,1)*XAX(I,1)+CMAT(2,2)*XAX(I,2)+CMAT(2,3)*XAX(I,3)
      WS2=CMAT(2,1)*XBX(I,1)+CMAT(2,2)*XBX(I,2)+CMAT(2,3)*XBX(I,3)
C
      GAM(K,I,7)=GAM(K,I,7)+WS1
      GAM(K,I1,7)=GAM(K,I1,7)+WS2
C
   80 CONTINUE
C
C     FIND GRAVITY GRADIENT FORCES FOR AN AND BN EQUATIONS
C
      SUMA=DZERO
      SUMB=DZERO
      DO 85 J=1,3
      DO 85 L=1,3
      SUMA=SUMA+GBK(J,L)*XXA(I,J,L)
      SUMB=SUMB+GBK(J,L)*XXB(I,J,L)
   85 CONTINUE
C
C     FIND INERTIAL TERMS FOR AN AND BN EQUATIONS
C
      CONA2=OMK(1)*XDXA(I,1)+OMK(2)*XDXA(I,2)+OMK(3)*XDXA(I,3)
      CONB2=OMK(1)*XDXB(I,1)+OMK(2)*XDXB(I,2)+OMK(3)*XDXB(I,3)
      CONA2=2.0D0*CONA2
      CONB2=2.0D0*CONB2
C
      CONA3=-(O22+O33)*XXA(I,1,1)-(O33+O11)*XXA(I,2,2)
     1      -(O11+O22)*XXA(I,3,3)+O12*(XXA(I,1,2)+XXA(I,2,1))
     2      +O13*(XXA(I,1,3)+XXA(I,3,1))+O23*(XXA(I,2,3)+XXA(I,3,2))
      CONB3=-(O22+O33)*XXB(I,1,1)-(O33+O11)*XXB(I,2,2)
     1      -(O11+O22)*XXB(I,3,3)+O12*(XXB(I,1,2)+XXB(I,2,1))
     2      +O13*(XXB(I,1,3)+XXB(I,3,1))+O23*(XXB(I,2,3)+XXB(I,3,2))
C
      RT2(K,I)=RT2(K,I)+SUMA-XDDXA(I)-CONA2-CONA3-VIFA(I)
      RT2(K,I1)=RT2(K,I1)+SUMB-XDDXB(I)-CONB2-CONB3-VIFB(I)
C
C
      IF(IOUT.EQ.1) GO TO 100
      WRITE(6,6005) I
 6005 FORMAT('0 OUTPUT FROM BENDING LOOP FOR MODE',I2/)
      WRITE(6,6006) SUMA,XDDXA(I),CONA2,CONA3,VIFA(I)
      WRITE(6,6006) SUMB,XDDXB(I),CONB2,CONB3,VIFB(I)
 6006 FORMAT(' ',5X,1P5E14.6)
C
  100 CONTINUE
C
C
C
  200 CONTINUE
C
C     ADD TWIST EQUATION
C
      IF(NTW.EQ.0) GO TO 400
C
      DO 300 I=1,NTW
      I1=NKB2+I
C
C     AUGMENT DELTA MATRIX
C
      DO 210 J=1,NTW
      J1=NKB2+J
      DEL(K,I1,J1)=DLCC(I,J)
  210 CONTINUE
C
C
C
      DO 212 J=1,3
      VW1(J)=FCM(J,1)*XCX(I,1)+FCM(J,2)*XCX(I,2)+FCM(J,3)*XCX(I,3)
  212 CONTINUE
C
      DO 214 J=1,3
      J1=J+3
      GAM(K,I1,J1)=GAM(K,I1,J1)+VW1(J)
  214 CONTINUE
C
      IF(IDAMP.EQ.0.OR.K.GT.K1) GO TO 220
C
      WS1=CMAT(2,1)*XCX(I,1)+CMAT(2,2)*XCX(I,2)+CMAT(2,3)*XCX(I,3)
C
      GAM(K,I1,7)=GAM(K,I1,7)+WS1
C
  220 CONTINUE
C
C     GRAVITY GRADIENT FOR TWIST EQUATION
C
      SUMC=DZERO
      DO 230 J=1,3
      DO 230 L=1,3
      SUMC=SUMC+GBK(J,L)*XXC(I,J,L)
  230 CONTINUE
C
C     INERTIAL TERMS FOR TWIST EQUATION
C
      CONC2=OMK(1)*XDXC(I,1)+OMK(2)*XDXC(I,2)+OMK(3)*XDXC(I,3)
      CONC2=2.0D0*CONC2
C
      CONC3=-(O22+O33)*XXC(I,1,1)-(O33+O11)*XXC(I,2,2)
     1      -(O11+O22)*XXC(I,3,3)+O12*(XXC(I,1,2)+XXC(I,2,1))
     2      +O13*(XXC(I,1,3)+XXC(I,3,1))+O23*(XXC(I,2,3)+XXC(I,3,2))
C
      RT2(K,I1)=RT2(K,I1)+SUMC-XDDXC(I)-CONC2-CONC3-VIFC(I)
C
C
      IF(IOUT.EQ.1) GO TO 300
      WRITE(6,6007) I
 6007 FORMAT('0 OUTPUT FROM TWIST LOOP FOR MODE',I2/)
      WRITE(6,6006) SUMC,XDDXC(I),CONC2,CONC3,VIFC(I)
C
  300 CONTINUE
C
C
C
  400 CONTINUE
C
C     TRANSFORM SYSTEM TERMS TO MAIN BODY FRAME
C
      DO 410 J=1,3
      YKYDD(J)=FCM(J,1)*XXDD(1)+FCM(J,2)*XXDD(2)+FCM(J,3)*XXDD(3)
  410 CONTINUE
C
      CALL MPYMAT(FCM,XXD,FCM,2,2,DUM1,YKYD)
      CALL MPYMAT(FCM,XX,FCM,2,2,DUM1,YKY)
C
C     SUM CONTRIBUTION TO SYSTEM EQUATIONS
C
      CON=RO*ZL
C
      DO 420 I=1,3
      DO 419 J=1,3
      YY(I,J)=YY(I,J)+YKY(I,J)*CON
      YYD(I,J)=YYD(I,J)+YKYD(I,J)*CON
  419 CONTINUE
      YYDD(I)=YYDD(I)+YKYDD(I)*CON
  420 CONTINUE
C
C     INCREMENT COUNTERS
C
      IA=IA+NKB2
      IB=IB+NKB2
      IC=IC+2*NTW
C
C     ADD IF DAMPER ELEMENT
C
      IF(IDAMP.EQ.0.OR.K.GT.K1) GO TO 500
C
      DO 430 J=1,3
      ZKZDD(J)=CMAT(J,1)*XXDD(1)+CMAT(J,2)*XXDD(2)+CMAT(J,3)*XXDD(3)
  430 CONTINUE
C
      CALL MPYMAT(CMAT,XXD,CMAT,2,2,DUM1,ZKZD)
      CALL MPYMAT(CMAT,XX,CMAT,2,2,DUM1,ZKZ)
C
      DO 440 I=1,3
      DO 439 J=1,3
      ZZ(I,J)=ZZ(I,J)+ZKZ(I,J)*CON
      ZZD(I,J)=ZZD(I,J)+ZKZD(I,J)*CON
  439 CONTINUE
      ZZDD(I)=ZZDD(I)+ZKZDD(I)*CON
  440 CONTINUE
C
C
C
  500 CONTINUE
C
C
C     AUGMENT SYSTEM EQUATIONS
C
C     GRAVITY GRADIENT MOMENTS
      DO 540 I=1,3
      I1=II(I)
      J1=JJ(I)
      GGM(I)=DZERO
      DO 535 J=1,3
      GGM(I)=GGM(I)+YY(I1,J)*GBY(J1,J)-YY(J1,J)*GBY(I1,J)
  535 CONTINUE
  540 CONTINUE
C
C     CONSTRUCT INERTIAL TERMS
C
      WS1=YYD(1,1)+YYD(2,2)+YYD(3,3)
      DO 560 I=1,3
      CON2(I)=-YYD(1,I)*OMEG(1)-YYD(2,I)*OMEG(2)-YYD(3,I)*OMEG(3)
      CON2(I)=CON2(I)+OMEG(I)*WS1
      CON2(I)=2.0D0*CON2(I)
  560 CONTINUE
C
      WS1=OMEG(1)*OMEG(1)+OMEG(2)*OMEG(2)+OMEG(3)*OMEG(3)
C
      DO 580 I=1,3
      I1=II(I)
      J1=JJ(I)
      CON3(I)=DZERO
      DO 570 J=1,3
      CON3(I)=CON3(I)+OMEG(I)*OMEG(J)*(YY(I1,J)-YY(J1,J))
  570 CONTINUE
      CON3(I)=CON3(I)-WS1*(YY(I1,I)-YY(J1,I))
  580 CONTINUE
C
C     INCREMENT ALP MATRIX AND RT1
C
      WS1=YY(1,1)+YY(2,2)+YY(3,3)
      DO 600 I=1,3
      I1=I+3
      DO 595 J=1,3
      J1=J+3
      ALP(I1,J1)=ALP(I1,J1)-YY(I,J)
  595 CONTINUE
      ALP(I1,I1)=ALP(I1,I1)+WS1
      RT1(I1)=RT1(I1)+GGM(I)-YYDD(I)-CON2(I)-CON3(I)
  600 CONTINUE
C
C     IF DAMPER CASE AUGMENT DAMPER EQUATION
C
      IF(IDAMP.EQ.0) GO TO 800
C
C     GRAVITY GRADIENT MOMENT
C
      CALL MPYMAT(FM1,GBY,FM1,2,2,DUM1,GBZ)
C
      I1=3
      J1=1
      SUMD=DZERO
      DO 720 I=1,3
      SUMD=SUMD+GBZ(J1,I)*ZZ(I1,I)-GBZ(I1,I)*ZZ(J1,I)
  720 CONTINUE
C
C     INERTIA TERMS FOR DAMPER EQUATION
C
      DO 730 I=1,3
      OMZ(I)=FM1(1,I)*OMEG(1)+FM1(2,I)*OMEG(2)+FM1(3,I)*OMEG(3)
  730 CONTINUE
C
      COND2=-ZZD(1,2)*OMZ(1)+(ZZD(3,3)+ZZD(1,1))*(OMZ(2)+PHID)
     1      -ZZD(3,2)*OMZ(3)
      COND2=2.0D0*COND2
C
      COND3=(OMZ(1)*OMZ(1)-OMZ(3)*OMZ(3))*ZZ(1,3)
     1      +OMZ(1)*OMZ(3)*(ZZ(3,3)-ZZ(1,1))
     2      +OMZ(2)*(OMZ(1)*ZZ(2,3)-OMZ(3)*ZZ(1,2))
C
C     SYSTEM INERTIA TERMS DUE TO DAMPER MOTION
C
      WS1=2.0D0*PHID
      WS2=PHID*PHID
C
      VW1(1)=-WS1*ZZD(2,1)
      VW1(2)=WS1*(ZZD(3,3)+ZZD(1,1))
      VW1(3)=-WS1*ZZD(2,3)
C
      VW2(1)=-WS1*(OMZ(3)*ZZ(3,3)-OMZ(1)*ZZ(1,3)+OMZ(2)*ZZ(2,3))
     1       -WS2*ZZ(2,3)
      VW2(2)=DZERO
      VW2(3)=WS1*(OMZ(3)*ZZ(1,3)-OMZ(1)*ZZ(1,1)+OMZ(2)*ZZ(1,2))
     1       +WS2*ZZ(1,3)
C
      DO 735 I=1,3
      CON2(I)=FM1(I,1)*VW1(1)+FM1(I,2)*VW1(2)+FM1(I,3)*VW1(3)
      CON3(I)=FM1(I,1)*VW2(1)+FM1(I,2)*VW2(2)+FM1(I,3)*VW2(3)
      I3=I+3
      RT1(I3)=RT1(I3)-CON2(I)-CON3(I)
  735 CONTINUE
C
C     AUGMENT ALP MATRIX AND RT1
C
      WS1=ZZ(3,3)+ZZ(1,1)
C
      ALP(7,4)=ALP(7,4)-ZZ(1,2)*FM1(1,1)+WS1*FM1(1,2)-ZZ(2,3)*FM1(1,3)
      ALP(7,5)=ALP(7,5)-ZZ(1,2)*FM1(2,1)+WS1*FM1(2,2)-ZZ(2,3)*FM1(2,3)
      ALP(7,6)=ALP(7,6)-ZZ(1,2)*FM1(3,1)+WS1*FM1(3,2)-ZZ(2,3)*FM1(3,3)
      ALP(7,7)=ALP(7,7)+WS1
      ALP(4,7)=ALP(7,4)
      ALP(5,7)=ALP(7,5)
      ALP(6,7)=ALP(7,6)
C
      RT1(7)=RT1(7)+SUMD-ZZDD(2)-COND2-COND3
C
C
  800 CONTINUE
C
C
      IF(IOUT.EQ.1) GO TO 900
      WRITE(6,6002)
 6002 FORMAT('0',5X,'ALP FROM DEREQT'/)
      WRITE(6,6003) ALP
 6003 FORMAT(' ',1P7E14.6)
      WRITE(6,6001) GBY,YY,YYD,YYDD,GGM,CON2,CON3,OMEG
      WRITE(6,6004) RT1
 6004 FORMAT('0RT1  ',1P7E14.6)
  900 CONTINUE
C
C
      RETURN
C
      END
